//package com.yunxin.admin.system.api.core.page;
//
//import com.yunxin.admin.system.infra.common.constant.SecurityConstants;
//import com.yunxin.admin.system.infra.framework.resubmit.Resubmit;
//import com.yunxin.admin.system.infra.framework.security.util.SecurityUtils;
//import com.yunxin.common.result.PageResult;
//import com.yunxin.common.result.Result;
//import com.yunxin.core.application.command.page.AddPageCommand;
//import com.yunxin.core.application.command.page.PagePageCommand;
//import com.yunxin.core.application.command.page.UpdatePageCommand;
//import com.yunxin.core.application.dto.page.PageListDTO;
//import com.yunxin.core.application.dto.page.PagePageDTO;
//import com.yunxin.core.application.service.PageApplicationAdminService;
//import com.yunxin.core.application.service.PageQueryAdminService;
//import io.swagger.v3.oas.annotations.Operation;
//import io.swagger.v3.oas.annotations.security.SecurityRequirement;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.security.access.prepost.PreAuthorize;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * @author zero°
// * @since 2023-05-29
// */
//@Tag(name = "41.页面管理")
//@Slf4j
//@RestController
//@RequestMapping("/core/v1/page")
//@RequiredArgsConstructor
//public class PageController {
//
//    private final PageApplicationAdminService pageApplicationAdminService;
//
//    private final PageQueryAdminService pageQueryAdminService;
//
//    @Operation(summary = "新增页面", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/addPage")
//    //@PreAuthorize("@ss.hasPerm('core:page:add')")
//    @Resubmit
//    public Result<Boolean> addPage(@Validated @RequestBody AddPageCommand command) {
//        command.setCreator(SecurityUtils.X.getUser().getUsername());
//        return Result.success(pageApplicationAdminService.addPage(command));
//    }
//
//    @Operation(summary = "更新页面", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/updatePage")
//    //@PreAuthorize("@ss.hasPerm('core:page:edit')")
//    public Result<Boolean> updatePage(@Validated @RequestBody UpdatePageCommand command) {
//        command.setEditor(SecurityUtils.X.getUser().getUsername());
//        return Result.success(pageApplicationAdminService.updatePage(command));
//    }
//
//    @Operation(summary = "获取页面下拉列表", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @GetMapping("/listPage")
//    public Result<List<PageListDTO>> listPage() {
//        List<PageListDTO> result = pageQueryAdminService.listPage();
//        return Result.success(result);
//    }
//
//    @Operation(summary = "分页查询页面列表", security = {@SecurityRequirement(name = SecurityConstants.TOKEN_KEY)})
//    @PostMapping("/pagePageQuery")
//    public PageResult<PagePageDTO> pagePageQuery(@Validated @RequestBody PagePageCommand command) {
//        return pageQueryAdminService.pagePageQuery(command);
//    }
//
//}
